package org.example.dto;

public abstract class Animal<B extends Animal<B>> {

    private B thisB;
    private String name;
    private String type;
    private Integer age;
    private String color;

    public Animal(){
        thisB = (B) this;
    }

    public B name(String name){
        this.name = name;
        return thisB;
    }

    public B type(String type){
        this.type = type;
        return thisB;
    }

    public B age(Integer age){
        this.age = age;
        return thisB;
    }

    public B color(String color){
        this.color = color;
        return thisB;
    }
}
